<style type="text/css">
    table th span{
        cursor: pointer;
    }
    table th span:hover{
        color:#aaa;
    }
    .page_nav li{list-style: none;float: left;}
    .page_nav li a{padding:5px;text-decoration: none;}
</style>
<form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
    <div class="data-table ">
        <table class="">
            <thead>
            <tr>
                <th style="width: 1px;" class="text-center">
                <!--
                    <input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);">
                -->    
                </th>                
                <th >
                    <span onclick="javascript:sort('goods_id');">ID</span>
                </th>
                <th >
                    <span onclick="javascript:sort('goods_name');">商品名称</span>
                </th>
                <th class="text-left">
                    <span onclick="javascript:sort('goods_sn');">货号</span>
                </th>                                
                <th class="text-left">
                    <span onclick="javascript:sort('cat_id');">分类</span>
                </th>                
                <th class="text-left">
                    <span onclick="javascript:sort('shop_price');">价格</span>
                </th>
                <th class="text-left">
                    <span onclick="javascript:void(0);">库存</span>
                </th>                
                <th class="text-center">
                    <span onclick="javascript:sort('is_on_sale');">上架</span>
                </th>
                <th class="text-center">
                    <span onclick="javascript:sort('is_recommend');">推荐</span>
                </th>
                <th class="text-center">
                    <span onclick="javascript:sort('is_new');">新品</span>
                </th>   
                <th class="text-center">
                    <span onclick="javascript:sort('is_hot');">热卖</span>
                </th>                   
                <th class="text-center">
                    <span onclick="javascript:sort('sort');">排序</span>
                </th>                   
                <th class="text-right">操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="goodsList" id="list">
                <tr>
                    <td class="text-center">
                       <!-- <input type="checkbox" name="selected[]" value="6">-->
                        <input type="hidden" name="shipping_code[]" value="flat.flat">
                    </td>
                    <td class="text-right">{$list.goods_id}</td>
                    <td class="text-left">{$list.goods_name|getSubstr=0,33}</td>
                    <td class="text-left">{$list.goods_sn}</td>
                    <td class="text-left">{$catList[$list[cat_id]][name]}</td>
                    <td class="text-left">{$list.shop_price}</td>
                    <td class="text-left">
                    <input type="text" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')"  onchange="ajaxUpdateField(this);" name="store_count" size="4" data-table="goods" data-id="{$list.goods_id}" value="{$list.store_count}"/>   
                    </td>
                    <td class="text-center">                        
                        <img width="20" height="20" src="__PUBLIC__/images/<if condition='$list[is_on_sale] eq 1'>yes.png<else />cancel.png</if>" onclick="changeTableVal('goods','goods_id','{$list.goods_id}','is_on_sale',this)"/>
                    </td>
                    <td class="text-center">
                        <img width="20" height="20" src="__PUBLIC__/images/<if condition='$list[is_recommend] eq 1'>yes.png<else />cancel.png</if>" onclick="changeTableVal('goods','goods_id','{$list.goods_id}','is_recommend',this)"/>
                    </td>
                    <td class="text-center">
                        <img width="20" height="20" src="__PUBLIC__/images/<if condition='$list[is_new] eq 1'>yes.png<else />cancel.png</if>" onclick="changeTableVal('goods','goods_id','{$list.goods_id}','is_new',this)"/>
                    </td>
                    <td class="text-center">
                        <img width="20" height="20" src="__PUBLIC__/images/<if condition='$list[is_hot] eq 1'>yes.png<else />cancel.png</if>" onclick="changeTableVal('goods','goods_id','{$list.goods_id}','is_hot',this)"/>
                    </td>                                        
                    <td class="text-center">                         
                        <input type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" onchange="updateSort('goods','goods_id','{$list.goods_id}','sort',this)" size="4" value="{$list.sort}" />
                    </td>                    
                    <td class="text-right">
                        <a  target="_blank" href="{:U('Home/Shop/goodsInfo',array('id'=>$list['goods_id']))}"data-original-title="">查看详情</a><!--前台地址-->
                        <a href="{:U('/Admin/Shop/addEditGoods',array('id'=>$list['goods_id']))}">编辑</a>
                        <a href="javascript:void(0);" onclick="del('{$list[goods_id]}')" id="button-delete6">删除</a></td>
                </tr>
            </volist>
            </tbody>
        </table>
    </div>
</form>
<div class="page_nav fl">
            {$page}
        </div>
<script>
    // 点击分页触发的事件
    $(".pagination  a").click(function(){
        cur_page = $(this).data('p');
        ajax_get_table('search-form2',cur_page);
    });
</script>